package com.ruoyi.hotSpot.handle;//package com.ruoyi.electronicFence.handle;
//
//import net.postgis.jdbc.PGgeometry;
//import net.postgis.jdbc.geometry.Geometry;
//import org.apache.ibatis.type.BaseTypeHandler;
//import org.apache.ibatis.type.JdbcType;
//import org.apache.ibatis.type.MappedTypes;
//
//import java.sql.CallableStatement;
//import java.sql.PreparedStatement;
//import java.sql.ResultSet;
//import java.sql.SQLException;
//
///**
// * @author 七月
// * @date 2024/8/14
// */
//@MappedTypes(String.class)
//public class PgGeometry84TypeHandler extends BaseTypeHandler<String> {
//
//    @Override
//    public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException {
////         PGgeometry pGgeometry = new PGgeometry(parameter);
////         Geometry geometry = pGgeometry.getGeometry();
////         geometry.setSrid(4326);
////         ps.setObject(i, pGgeometry);
//    }
//
//    @Override
//    public String getNullableResult(ResultSet resultSet, String columnName) throws SQLException {
//        String string = resultSet.getString(columnName);
//        return getResult(string);
//    }
//
//    @Override
//    public String getNullableResult(ResultSet resultSet, int columnIndex) throws SQLException {
//        String string = resultSet.getString(columnIndex);
//        return getResult(string);
//    }
//
//    @Override
//    public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
//        String string = cs.getString(columnIndex);
//        return getResult(string);
//    }
//
//    private String getResult(String stValue) throws SQLException {
//        PGgeometry pGgeometry = new PGgeometry(stValue);
//        String s = pGgeometry.toString();
//        return s.replace("SRID=4326", "");
//    }
//}
